The Primitive Form of Shape Geometries
QuickDraw GX provides a mechanism for incorporating the stylistic variations contained in a style object directly into the geometry of a shape object. This mechanism is theGXPrimitiveShape
function. When the geometry of a shape has its stylistic variations incorporated into it, it is said to be in primitive form. Shapes in primitive form include
Figure 4-8 shows a simple example of the
- empty shapes and full shapes, which are described in Chapter 2, "Geometric Shapes"
- filled rectangle, polygon, and path shapes, which are also described in Chapter 2, "Geometric Shapes"
- hairline framed shapes, which are described in Chapter 3, "Geometric Styles"
- glyph shapes, which are described in Inside Macintosh: QuickDraw GX Typography
GXPrimitiveShape
function. This figure shows a line geometry as drawn with a pen width of 10.0. Converting this line shape to its primitive form results in a rectangle shape with an even-odd fill; the pen width has been incorporated into the geometry of the shape.Figure 4-8 Simple example of the
GXPrimitiveShape
function
Figure 4-9 shows a more involved example--a line shape dashed with diamond-shaped polygons. Converting this line shape to its primitive form results in a polygon shape with multiple contours--one contour for each dash.
Figure 4-9 More involved example of the
GXPrimitiveShape
function
Notice that, even though the geometry of the shape has changed significantly, the shape appears the same when drawn. Also notice that the
GXPrimitiveShape
function affects only the shape type, shape geometry, and shape fill of a shape--it does not affect the shape's associated style object. In the example in Figure 4-9, the result of theGXPrimitiveShape
function has a pen width of 10.0 and dash shape. However, since the shape fill was changed to even-odd fill, these aspects of the style are ignored when the shape is drawn.For a complete description of the primitive forms of shapes, see the reference description of the
GXPrimitiveShape
function, which is on page 4-79. For some examples that demonstrate when it is necessary to use primitive shapes, see the descriptions of caps, joins, dashes, and patterns in Chapter 3, "Geometric Styles," in this book, and the description of clip shapes in Inside Macintosh: QuickDraw GX Objects.For programming examples illustrating shapes in their primitive form, see "Converting a Shape to Primitive Form" beginning on page 4-38.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help